#include <iostream>
using namespace std;

void Square(int& number)
{
	number *= number;
}

void Square(const int& number, int& result)
{
	result = number * number;
}

int main()
{
	int original = 30;
	cout  << original << endl;//30
	cout  << hex << &original << endl;//内存地址
	int& ref1 = original;
	cout << hex << &ref1 << endl;//第一个引用地址
	int& ref2 = ref1;
	cout  << hex << &ref2 << endl;//第二个引用地址
	cout  << dec << ref2 << endl;//30
	//
	int number = 3;
	Square(number);
	cout << number << endl;//9
	//
	int square = 4;
	Square(number, square);
	cout << number << " = " << square << endl;//81

	return 0;
}